package edu.sctu.zhengsenwen.month201505.day20150521;


/**
 * Created by user15 on 2015/5/21.
 */
public class TextMore {

    Teacher[] teacher;

    public TextMore(Teacher[] teacher){
        this.teacher=teacher;
    }

    public Teacher[] sortNumber(){
        Teacher[] teachernumber = new Teacher[0];
        for(int i=0;i<(teacher.length-1);i++){
                for(int j=0;j<(teacher.length-1);j++){
                if(teacher[j].number > teacher[j+1].number){
                    teachernumber[0] = teacher[j];
                    teacher[j] = teacher[j+1];
                    teacher[j+1] = teachernumber[0];
                }
            }
        }

        return teachernumber;
    }

    public Student[] sortStudent(Student[] student){
        Student[] studentcode = new Student[student.length];

        for(int i=0;i<(student.length-1);i++){
            for(int j=0;j<(student.length-1);j++){
                if(student[j].code > student[j+1].code){
                    studentcode[0] = student[j];
                    student[j] = student[j+1];
                    student[j+1] = studentcode[0];
                }
            }
            studentcode[i] = student[i];

        }

        return studentcode;
    }


    public Teacher pritCode(){
       Teacher teacherposition = null;
//        Teacher[] teacherposition = new Teacher[teacher.length];
        for(Teacher teacher:this.teacher) {

            if (teacher.position.equals("教授")) {
            }
        }
        return teacherposition;
    }
}
